package a.h;

import javax.swing.*;
import java.awt.*;
import java.util.Collection;
import java.util.Iterator;

class od
  extends DefaultComboBoxModel
{
  private int a;
  private int b;
  
  public od(int paramInt)
  {
    this.a = paramInt;
  }
  
  public od(int paramInt, Collection paramCollection)
  {
    this(paramInt);
    Iterator localIterator = paramCollection.iterator();
    while (localIterator.hasNext()) {
      a((Color)localIterator.next());
    }
  }
  
  public int a(Color paramColor)
  {
    int i = getIndexOf(paramColor);
    if (i >= 0)
    {
      removeElement(paramColor);
      this.b -= 1;
    }
    this.b += 1;
    if (this.b == this.a + 1)
    {
      removeElementAt(0);
      this.b -= 1;
    }
    if (this.b >= getSize()) {
      addElement(paramColor);
    } else {
      a(this.b, paramColor);
    }
    return this.b;
  }
  
  public void a(int paramInt, Color paramColor)
  {
    removeElementAt(paramInt);
    insertElementAt(paramColor, paramInt);
  }
  
  public Color a(int paramInt)
  {
    return (Color)getElementAt(paramInt);
  }
  
  public int a()
  {
    return this.a;
  }
  
  public void c(int paramInt)
  {
    this.a = paramInt;
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.h.od

 * JD-Core Version:    0.7.0.1

 */